package february.test_2_28;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int count = 0;
            int n = scanner.nextInt();
            int k = weiShu(n);
            for(int i = k; i >= 0; i--) {
                if(Math.pow(2,i) <= n) {
                    count++;
                    n -= Math.pow(2,i);
                }
            }
            System.out.println(count);
        }
    }
    public static int weiShu(int n) {
        int i = 0;
        while (true) {
            if(Math.pow(2,i) >= n) {
                return i;
            }
            i++;
        }
    }
}
